namespace admin.application.Common;
    public class ResponseResult<T>
    {
        public int Code { get; set; }
        public string Message { get; set; }
        public T Data { get; set; }

        public ResponseResult() { }

        public ResponseResult(int code, string message, T data, string error = null)
        {
            Code = code;
            Message = message;
            Data = data;
        }

        public static ResponseResult<T> Ok(T data, string message = "操作成功")
        {
            return new ResponseResult<T>(200, message, data);
        }

        public static ResponseResult<T> Fail(string message = "操作失败", int code = 500)
        {
            return new ResponseResult<T>(code, message, default(T));
        } 
}
